import request from '@/utils/request'

export const getQueryAdvert = () => {
  return request({
    method: 'GET',
    url: '/front/ad/getAdList'
  })
}

export const createOrUpdateAdvert = (data: any) => {
  return request({
    method: 'POST',
    url: '/front/ad/saveOrUpdate',
    data
  })
}

export const getEditAdvertInfo = (id: string | number = -1) => {
  return request({
    method: 'GET',
    url: '/front/ad/getAdById',
    params: {
      id
    }
  })
}

export const changeAdvertState = (data: any) => {
  return request({
    method: 'GET',
    url: '/front/ad/updateStatus',
    data
  })
}

export const uploadAdvertImg = (data: any) => {
  return request({
    method: 'POST',
    url: '/boss//course/upload',
    data
  })
}
